<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			// var arr = ["唐僧","沙僧","tom"]
			
			/* var n = arr.push("悟空","八戒");
			console.log(n,arr); */
			
			/* var o = arr.pop();
			console.log(o,arr);
			
			var b = arr.shift();
			console.log(b,arr); */
			
			/* var arr2 = arr.slice(0,2);
			console.log(arr2.toString()); */
			
			// var arr = ["唐僧","沙僧","tom"]
			/* 添加
			arr.splice(1,0,"悟空","八戒");
			删除
			arr.splice(2,1);
			替换 */
			/* arr.splice(2,1,"悟空","八戒");
			
			console.log(arr); */
			
			var arr = ["唐僧","沙僧","tom"];
			
			arr.forEach(function(item,index){
				console.log(item+"-"+index);
			})
			
		</script>
	</head>
	<body>
	</body>
</html>
